/**
 * Copyright @ 2023 iAuto (Shanghai) Co., Ltd.
 * All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are NOT permitted except as agreed by
 * iAuto (Shanghai) Co., Ltd.
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 */

export interface SkillObj {
  mID: number;
  mClassName: string;
  mConfig: number;
  mName: string;
  mDesc: string;
  mPermission: number;
  mVersion: number;
  mType: number;
  mSteps: MStep[];
  mInputArgs: MInputArg[];
}

export interface MInputArg {
  mName: string;
  mType: number;
  mDefaultValue: string;
  mDesc: Record<string, string>;
  [extraKey: string]: any;
}

export interface MStep {
  mServiceName: string;
  mInstanceID: number;
  mGlobalName: string;
  mType: number;
  mMethodArgs: MMethodArg[];
  mExpression: MExpression;
  mJudgement: string;
}

export interface MExpression {
  mOperator: number;
  mOpLeft: MOpLeft;
  mOpRight: MOpLeft;
}

export interface MOpLeft {
  mType: number;
  mValue: string;
}

export interface MMethodArg {
  mName: string;
  mType: number;
  mIsInput: boolean;
  mValue: string;
}

export interface Blocks {
  blocks: {
    opcode: number;
    text: string;
    blockType: string;
    arguments: object;
    type: number;
    func: string;
  }[];
  menus: Record<string, Menus>;
  sort: string;
}

export interface Menus {
  items: {
    text: string;
    value: string | number;
  }[];
  acceptReporters: boolean;
}
